
import app from "src/app";
var ObjectId = require('mongodb').ObjectId;

import configFile from './config';

import 'src/route/playerRoute'
import 'src/route/rankRoute'
import 'src/route/gameRoute'
import playerSessionHandle from "./handle/playerSessionHandle";



if (process.argv.length >= 3 && configFile[process.argv[3]]) {
    app.env = process.argv[3]
    app.config = configFile[process.argv[3]]

} else {
    app.env = 'dev'
    app.config = configFile['dev']
 
}
let forkID = Number(process.argv[2])
console.log('forkID:', forkID)
app.forkID = forkID
playerSessionHandle.init()